Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Powered Arms Dealer Door Still Open When Chain Building Technicals and Combat Bikes #538

Merged
merged 1 commit into from
Oct 16, 2021

Conversation

commy2
Copy link
Collaborator

@commy2 commy2 commented Oct 9, 2021

ZH 1.04:

door.mp4

Patch:

door-gla-fixed.mp4

@commy2 commy2 added the Bug Something is not working right label Oct 9, 2021
@commy2
Copy link
Collaborator Author

commy2 commented Oct 9, 2021

Aside from visuals, this means that Technical build time is 12 sec w/o power and 7 sec w/ power now always.

In 1.04, it is - with power - 7 seconds for the first Technical only, and 5 seconds starting from the second Technical.

Behavior = ProductionUpdate ModuleTag_10
NumDoorAnimations = 1
DoorOpeningTime = 2000 ;in mSeconds
DoorWaitOpenTime = 3000 ;in mSeconds
DoorCloseTime = 2000 ;in mSeconds
DoorWaitOpenTime = 2000 ;in mSeconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Wouldn't it have been enough to just decrease DoorWaitOpenTime by a few milliseconds? I don't understand why 2 variables had to be changed. Plus now Door close is quicker than door open. Why?

Copy link
Collaborator Author

@commy2 commy2 Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus now Door close is quicker than door open. Why?

The time it takes for the door to close is animation based, so part of the model. DoorCloseTime is used to make the logic register that the door was already closed. You could set DoorCloseTime to 2 minutes and it wouldn't speed up / slow down the animation at all.

Wouldn't it have been enough to just decrease DoorWaitOpenTime by a few milliseconds?

The game is not precise enough for a few msecs to mean anything. It runs at 30 FPS in multiplayer, so to make an actual difference, you need at least 33.33 msecs (= 1 frame).

Copy link
Collaborator Author

@commy2 commy2 Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may help:

https://i.imgur.com/PGIyjQh.png

Edit: oops, replace "fps" with "milliseconds per frame". 1/30 FPS = 0.033 seconds per frame.

Copy link
Collaborator Author

@commy2 commy2 Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition for not bugging out door opening for fast building units:
DoorWaitOpenTime + DoorCloseTime < (fastest) BuildTime
2000 msec + 1800 msec < 4.0 sec (Combat Bike w/ power)
3800 msec < 4000 msec, check

Condition for not bugging out door animation:
<animation frame count> / 30 FPS < DoorCloseTime
50 (Arms Dealer) / 30 FPS < 1800 msec
1667 msec < 1800 msec, check

Copy link
Collaborator Author

@commy2 commy2 Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DoorOpeningTime and DoorCloseTime do not determine the speed of the door animation. To not bug out the visuals, these must be bigger than the actual door animation time though.

DoorOpeningTime is important in that it adds a constant to actual build-time of units.

DoorCloseTime and DoorWaitOpenTime are less important, but must together be smaller than the fastest BuiltTime of any unit, otherwise the DoorOpeningTime delay is skipped.

If necessary, the door animations can be adjusted by using AnimationSpeedFactorRange in the W3DModelDraw module. That parameter can be used indepentently for door opening and closing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok now it makes sense. Bike build is 4000 ms. I was wondering why door close time is combined 3800 ms when Technical build is 5000 ms. What you refer to as "milliseconds per frame" is called "frame time" in programmer terms.

Copy link
Collaborator

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for detailed investigation and explanations!

@commy2 commy2 merged commit 5a4c3ce into main Oct 16, 2021
@commy2 commy2 deleted the fix-powered-arms-dealer-technical-production branch October 16, 2021 19:09
@commy2 commy2 mentioned this pull request Aug 13, 2022
xezon pushed a commit that referenced this pull request Aug 28, 2022
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Nerf Makes a thing less powerful GLA Affects GLA faction labels Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right GLA Affects GLA faction Minor Severity: Minor < Major < Critical < Blocker Nerf Makes a thing less powerful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants